package com.only4play.practice.pay;

import lombok.extern.slf4j.Slf4j;
import org.dromara.x.file.storage.spring.EnableFileStorage;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.annotation.MapperScans;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.web.client.RestTemplate;

/**
 * @author mdy
 * * @date 2024/9/23
 */
@SpringBootApplication
@MapperScans(
        {
                @MapperScan("com.only4play.practice.pay.reconcile.core.mapper"),
                @MapperScan("com.only4play.practice.pay.payment.core.mapper")

        }
)
@ComponentScans({
//        // 扫描自定义异常，不然不生效
        // 扫描自定义配置类，不然不生效
        @ComponentScan(basePackages = "com.only4play.practice.common")
})
@Slf4j
@EnableFileStorage
@EnableFeignClients
public class PracticePayCenterApp {
    public static void main(String[] args) {
        SpringApplication.run(PracticePayCenterApp.class, args);
        log.info("starting pay app");
    }

    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder builder){
        return builder.build();
    }
}
